/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "menuorder")
@XmlRootElement(name = "menuorder")
@NamedQueries({
    @NamedQuery(name = "Menuorder.findAll", query = "SELECT m FROM Menuorder m"),
    @NamedQuery(name = "Menuorder.findByMenuorderID", query = "SELECT m FROM Menuorder m WHERE m.menuorderID = :menuorderID"),
    @NamedQuery(name = "Menuorder.findByDescription", query = "SELECT m FROM Menuorder m WHERE m.description = :description"),
    @NamedQuery(name = "Menuorder.findBySeatno", query = "SELECT m FROM Menuorder m WHERE m.seatno = :seatno"),
    @NamedQuery(name = "Menuorder.findByIsdeleted", query = "SELECT m FROM Menuorder m WHERE m.isdeleted = :isdeleted"),
    @NamedQuery(name = "Menuorder.findByPrinted", query = "SELECT m FROM Menuorder m WHERE m.printed = :printed")})
public class Menuorder implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MenuorderID")
    private Long menuorderID;
    @Column(name = "description")
    private String description;
    @Column(name = "seatno")
    private Integer seatno;
    @Basic(optional = false)
    @Column(name = "isdeleted")
    private boolean isdeleted;
    @Basic(optional = false)
    @Column(name = "printed")
    private boolean printed;
    @JoinColumn(name = "tableorder_TableorderID", referencedColumnName = "TableorderID")
    @ManyToOne(optional = false)
    private Tableorder tableorder;
    @JoinColumn(name = "menusize_MenusizeID", referencedColumnName = "MenusizeID")
    @ManyToOne
    private Menusize menusize;
    @JoinColumn(name = "menu_MenuID", referencedColumnName = "MenuID")
    @ManyToOne(optional = false)
    private Menu menu;

    public Menuorder() {
    }

    public Menuorder(Long menuorderID) {
        this.menuorderID = menuorderID;
    }

    public Menuorder(Long menuorderID, boolean isdeleted, boolean printed) {
        this.menuorderID = menuorderID;
        this.isdeleted = isdeleted;
        this.printed = printed;
    }

    public Long getMenuorderID() {
        return menuorderID;
    }

    public void setMenuorderID(Long menuorderID) {
        this.menuorderID = menuorderID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getSeatno() {
        return seatno;
    }

    public void setSeatno(Integer seatno) {
        this.seatno = seatno;
    }

    public boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public boolean getPrinted() {
        return printed;
    }

    public void setPrinted(boolean printed) {
        this.printed = printed;
    }

    public Tableorder getTableorder() {
        return tableorder;
    }

    public void setTableorder(Tableorder tableorder) {
        this.tableorder = tableorder;
    }

    public Menusize getMenusize() {
        return menusize;
    }

    public void setMenusize(Menusize menusize) {
        this.menusize = menusize;
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (menuorderID != null ? menuorderID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menuorder)) {
            return false;
        }
        Menuorder other = (Menuorder) object;
        if ((this.menuorderID == null && other.menuorderID != null) || (this.menuorderID != null && !this.menuorderID.equals(other.menuorderID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Menuorder[menuorderID=" + menuorderID + "]";
    }

}
